import { POST, GET} from "@/utils/index";
import type {} from "@/mytype/index";

/* 修改商品是否推荐或者秒杀 */

interface updateFlag {
    proid: string,
    type: string,
    flag: boolean
}
export const editUpdataFlagApi = (data:updateFlag)=> POST("/pro/updateFlag", data);


/* 筛选商品 */

interface searchPro {
    category?: string,
    search?: string
} 
export const getSearchProApi = (data:searchPro) => POST("/pro/searchPro", data)

/* 获取商品的分类 */
export const getCategoryApi = ()=> GET("/pro/getCategory")

/* 获取商品的列表 */
interface proListParams {
    count?:number,
    limitNum?:number
}
export const getProListApi = (params?:proListParams) => GET("/pro/list", params)

/* 获取秒杀或者推荐的列表详情 */
/* 获取秒杀产品列表 */
export const getSecondProListApi = () => POST("/pro/showdata", {type:"isseckill", flag:1} );
/* 获取推荐产品列表 */
export const getRecommendProListApi = () => POST("/pro/showdata", {type:"isrecommend", flag:1})
